﻿using com.guojin.core.io.message;
using com.guojin.mj.net.message.login;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class WarRecordItemPage : EventManager
{
    public Text roomId;
    public Text dateTime;
    public Button detailsBtn;
    public Button shareBtn;
    private string authCode;

    public void Start()
    {
        AddListenerToButton(shareBtn, ShareBtnClick);
        AddListenerToButton(detailsBtn, DetailsBtnClick);
    }


    public void SetMsg(WarRecordRet rh)
    {
        authCode = rh.AuthCode;
        roomId.text = "房号：" + rh.RoomID;
        dateTime.text = rh.Time;
    }

    public void ShareBtnClick()
    {
        LoginAndShare.Controller.sharePng();
    }

    public void DetailsBtnClick()
    {
        UIManager.ChangeUI(UIManager.PageState.WarDetailsPage, (GameObject obj) =>
        {
            obj.GetComponent<WarDetailsPage>().InformationSetting();
        });

        MessageManager.GetInstance().SendMsg722(authCode);
    }

    public override void InformationSetting()
    {

    }
}
